package com.wuwei.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: NacosConfigController <br>
 * @date: 2021/2/20 10:59 <br>
 * @author: wuwei666 <br>
 * @version: 1.0 <br>
 * 支持Nacos的动态刷新功能，通过SpringCloud原生注解@RefreshScope实现配置自动更新
 */
@RestController
@RefreshScope
@Slf4j
public class NacosConfigController {
    @Value("${name}")
    private String githubName;

    @GetMapping("/nacos/config")
    public String getGithubName(){
        return githubName;
    }
}
